home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PRUS101 / FANSI.PAS < prev    next >
Pascal/Delphi Source File  |  1994-12-19  |  3KB  |  107 lines

  1. unit fansi;
  2.  
  3.  { FIDO unit to allow access to the Ansi-Routines
  4.  (*************************************************************************)
  5.  
  6.      RELEASE 1.00 - as first contained in the file PRUS101.LZH
  7.         by Matthias Tichy, 2:2440/210.14, GERMANY
  8.  
  9.            --------------------------------------------
  10.         organized for Fido's PASCAL related echoes
  11.            --------------------------------------------
  12.  
  13.      09/11/1994 to --/--/---- by Matthias Tichy, 2:2440/210.14, GERMANY
  14.  
  15.  
  16.        As far as third party copyrights are not violated this
  17.        source code is hereby placed to the public domain. Use
  18.        it whatever way you want, but use AT YOUR OWN RISK.
  19.  
  20.        In case you should modify the source rather send your
  21.        modifications to the unit's current organizer (see above for
  22.        NM address) than to spread it on your own. This will help to
  23.        keep the unit updated and grant a certain standard to all
  24.        other users as well.
  25.  
  26.        The unit is currently still under work. So it might greatly
  27.        benefit of your participation.
  28.  
  29.        Those who contributed to the following piece of source,
  30.        listed in alphabethical order:
  31.     ================================================================
  32.         Matthias Tichy ...
  33.     ================================================================
  34.        YOUR NAME WILL APPEAR HERE IF YOU CONTRIBUTE USEFUL SOURCE.
  35.  
  36.        Credits in your own programs are as welcome as unnecessary.
  37.  
  38. (***************************************************************************}
  39.  
  40. {$I FDEFINE.DEF} { Use the general include file for conditional defines and
  41.            common compiler directives ... }
  42.  
  43.          { ... and set the unit's specific defines aftwerwards. }
  44.  
  45. interface
  46.  
  47. const
  48.   Ansi_ClrScr = #27+'[2J';
  49.   Ansi_NoAtr = #27+'[0m';
  50.   Ansi_High = #27+'[1m';
  51.  
  52.   Ansi_fore_Black = #27+'[30m';
  53.   Ansi_fore_Red = #27+'[31m';
  54.   Ansi_fore_Green = #27+'[32m';
  55.   Ansi_fore_Yellow = #27+'[33m';
  56.   Ansi_fore_Blue = #27+'[34m';
  57.   Ansi_fore_Magenta = #27+'[35m';
  58.   Ansi_fore_Cyan = #27+'[36m';
  59.   Ansi_fore_White = #27+'[37m';
  60.  
  61.   Ansi_Back_black = #27+'[40m';
  62.   Ansi_Back_Red = #27+'[41m';
  63.   Ansi_Back_Green = #27+'[42m';
  64.   Ansi_Back_Yellow = #27+'[44m';
  65.   Ansi_Back_Blue = #27+'[44m';
  66.   Ansi_Back_Magenta = #27+'[45m';
  67.   Ansi_Back_Cyan = #27+'[46m';
  68.   Ansi_Back_White = #27+'[47m';
  69.  
  70. function isAnsi : Boolean;
  71.  
  72. implementation
  73.  
  74. {$IFDEF VER70}
  75.  
  76. function isAnsi : Boolean; assembler;
  77.  
  78. asm
  79.   mov ax, 1A00h
  80.   int 2Fh
  81.   mov ah, $1
  82.   cmp al, $ff
  83.   JE @@1
  84.   mov ah, $0
  85. @@1:
  86. end;
  87.  
  88. {$ELSE}
  89.  
  90. uses dos;
  91.  
  92. var
  93.   R : Registers;
  94.  
  95. function isAnsi : boolean;
  96.  
  97. begin
  98.   isAnsi := false;
  99.   R.AX := $1A00;
  100.   Intr($2F, R);
  101.   if R.AL <> $FF then isAnsi := true;
  102. end;
  103.  
  104. {$ENDIF}
  105.  
  106. end.
  107.